package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 投诉表
 */
@Entity
@Table(name = "complain", schema = "springboot", catalog = "")
public class Complain {
    private int planId;             //投诉id
    private String planSubject;     //投诉主题
    private String planClass;       //分类
    private Timestamp planDate;     //日期
    private BigInteger planUrgecy;  //紧急程度
    private String planReceiver;    //首问接待人
    private BigInteger planResult;  //处理结果
    private String planComplain;    //投诉人
    private String planDescribe;    //描述
    private String planCourse;      //处理过程
    private String planDates;       //花费时间
    private String planTicks;       //客户反馈
    private String planPay;         //回访确认
    private String planRemark;      //备注
    private Integer planDelete;     //逻辑删除
    private Customer customerByCustomId;

    public Complain() {

    }

    @Id
    @Basic
    @Column(name = "plan_id")
    public int getPlanId() {
        return planId;
    }

    public void setPlanId(int planId) {
        this.planId = planId;
    }

    @Basic
    @Column(name = "plan_subject")
    public String getPlanSubject() {
        return planSubject;
    }

    public void setPlanSubject(String planSubject) {
        this.planSubject = planSubject;
    }

    @Basic
    @Column(name = "plan_class")
    public String getPlanClass() {
        return planClass;
    }

    public void setPlanClass(String planClass) {
        this.planClass = planClass;
    }

    @Basic
    @Column(name = "plan_date")
    public Timestamp getPlanDate() {
        return planDate;
    }

    public void setPlanDate(Timestamp planDate) {
        this.planDate = planDate;
    }

    @Basic
    @Column(name = "plan_urgecy")
    public BigInteger getPlanUrgecy() {
        return planUrgecy;
    }

    public void setPlanUrgecy(BigInteger planUrgecy) {
        this.planUrgecy = planUrgecy;
    }

    @Basic
    @Column(name = "plan_receiver")
    public String getPlanReceiver() {
        return planReceiver;
    }

    public void setPlanReceiver(String planReceiver) {
        this.planReceiver = planReceiver;
    }

    @Basic
    @Column(name = "plan_result")
    public BigInteger getPlanResult() {
        return planResult;
    }

    public void setPlanResult(BigInteger planResult) {
        this.planResult = planResult;
    }

    @Basic
    @Column(name = "plan_complain")
    public String getPlanComplain() {
        return planComplain;
    }

    public void setPlanComplain(String planComplain) {
        this.planComplain = planComplain;
    }

    @Basic
    @Column(name = "plan_describe")
    public String getPlanDescribe() {
        return planDescribe;
    }

    public void setPlanDescribe(String planDescribe) {
        this.planDescribe = planDescribe;
    }

    @Basic
    @Column(name = "plan_course")
    public String getPlanCourse() {
        return planCourse;
    }

    public void setPlanCourse(String planCourse) {
        this.planCourse = planCourse;
    }


    @Basic
    @Column(name = "plan_dates")
    public String getPlanDates() {
        return planDates;
    }

    public void setPlanDates(String planDates) {
        this.planDates = planDates;
    }

    @Basic
    @Column(name = "plan_ticks")
    public String getPlanTicks() {
        return planTicks;
    }

    public void setPlanTicks(String planTicks) {
        this.planTicks = planTicks;
    }

    @Basic
    @Column(name = "plan_pay")
    public String getPlanPay() {
        return planPay;
    }

    public void setPlanPay(String planPay) {
        this.planPay = planPay;
    }

    @Basic
    @Column(name = "plan_remark")
    public String getPlanRemark() {
        return planRemark;
    }

    public void setPlanRemark(String planRemark) {
        this.planRemark = planRemark;
    }

    @Basic
    @Column(name = "plan_delete")
    public Integer getPlanDelete() {
        return planDelete;
    }

    public void setPlanDelete(Integer planDelete) {
        this.planDelete = planDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Complain complain = (Complain) o;
        return planId == complain.planId &&
                Objects.equals(planSubject, complain.planSubject) &&
                Objects.equals(planClass, complain.planClass) &&
                Objects.equals(planDate, complain.planDate) &&
                Objects.equals(planUrgecy, complain.planUrgecy) &&
                Objects.equals(planReceiver, complain.planReceiver) &&
                Objects.equals(planResult, complain.planResult) &&
                Objects.equals(planComplain, complain.planComplain) &&
                Objects.equals(planDescribe, complain.planDescribe) &&
                Objects.equals(planCourse, complain.planCourse) &&
                Objects.equals(planDates, complain.planDates) &&
                Objects.equals(planTicks, complain.planTicks) &&
                Objects.equals(planPay, complain.planPay) &&
                Objects.equals(planRemark, complain.planRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(planId, planSubject, planClass, planDate, planUrgecy, planReceiver, planResult, planComplain, planDescribe, planCourse, planDates, planTicks, planPay, planRemark);
    }

    @ManyToOne
    @JoinColumn(name = "custom_id", referencedColumnName = "custom_id")
    public Customer getCustomerByCustomId() {
        return customerByCustomId;
    }

    public void setCustomerByCustomId(Customer customerByCustomId) {
        this.customerByCustomId = customerByCustomId;
    }
}
